from django.shortcuts import render,render_to_response
from django.shortcuts import HttpResponse

# Create your views here.
import datetime

def index(request):
	print 'accesing index method....'
	return HttpResponse('this is test')

def func2(request):
	return HttpResponse(BASE_DIR)

def index2(request):
	userlist = [
				{'username':'chobit','password':'123456'},
				{'username':'chobit1','password':'1234561'},
				{'username':'chobit2','password':'1234562'},
				{'username':'chobit3','password':'1234563'},			
	]
	return render_to_response('demo.html',{'userlist':userlist})

def get_time(request):
	c_time = datetime.datetime.now()
	return HttpResponse('current time is :%s' % c_time)

def time_plus(request,plus_hours):
	c_time = datetime.datetime.now()
	return HttpResponse('current time is :%s + %s' % (c_time,plus_hours))

def get_name(request,name,name2):
	return HttpResponse('this  str name is : %s,name2 : %s' % (name,name2))

def get_info(request,name):
	return HttpResponse('get_info name is : %s' % (name))

def htmlinfo(request):
	name_dic = {
			'name1':'chobit',
			'name2':'chobit2',
			'name3':'chobit3',

	}
	return render_to_response('user.html',{'name':name_dic.items})